package vip.mtdp.base.service.rpc.impl;

import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;
import vip.mtdp.base.api.app.channel.AppChannelRpcService;
import vip.mtdp.base.api.app.channel.dto.AppChannelResponse;
import vip.mtdp.base.dal.cond.AppChannelCond;
import vip.mtdp.base.dal.dao.AppChannelMapper;
import vip.mtdp.base.dal.domain.AppChannel;
import vip.mtdp.common.exception.AppRTException;

import java.util.List;

/**
 * @description TODO
 * @date 2020/4/4 20:31
 * @auth wangguoqing
 **/
@Slf4j
@Service(version = "1.0.0")
public class AppChannelRpcServiceImpl implements AppChannelRpcService {

    @Autowired
    private AppChannelMapper appChannelMapper;

    @Override
    public AppChannelResponse queryChannelByInstallId(String installId) throws AppRTException {
        AppChannelCond appChannelCond = new AppChannelCond();
        appChannelCond.setInstallId(installId);
        List<AppChannel> appChannelList = appChannelMapper.query(appChannelCond);
        if(appChannelList == null || appChannelList.isEmpty()){
            return null;
        }
        AppChannelResponse response = new AppChannelResponse();

        //TODO 填充返回内容
        return response;
    }
}
